# conding = utf-8
from selenium.webdriver import ActionChains, Keys

from pages.page import Page
from pages.xgz.assemble.assemble import *
from pages.xgz.assemble import  *


class Assemble(Page):

    # 查询UI测试
    def open_admin(self):
        if self.display(leftmenu) is False:
            self.click(leftmenu_sys)
        self.click(leftmenu)

    def search_input(self, value):
        '''
        输入查询数据，完成查询动作
        :param value:
        :return:
        '''
        self.send_keys(number, value)

    def search_btn(self):
        '''
        单击查找按钮
        :return:
        '''
        self.click(queryx)

    def reset_select(self):
        self.click(reset_select)

    # 第2个查询、、、、、、、、、、、、、、、、、、、、、、、、、
    def commod(self, value):
        '''
        输入查询数据，完成查询动作
        :param value:
        :return:
        '''
        self.send_keys(commoditys, value)

    # 第3个输入框。。。。。。。。。。。。。。。。。。。。。。。。。。
    def timexe(self):
        self.click(timex)

    # 开头日期
    def zhankaiese(self):
        self.click(zhankai)

    # 结束日期
    def zhankaies(self):
        self.click(zhankaie)

    # 往下--------------------------------------------------
    def wangxiaeq(self):
        self.click(wangxia)

    # 第四个输入框--------------------------------------------
    # def add_wuliao_type(self):
    #     # 物料产品类型
    #     self.click(tieuj)  # 点击下拉框
    #     actions = ActionChains(self.driver)  # 定义动作链
    #     actions.send_keys(Keys.DOWN)  # 下键
    #     actions.send_keys(Keys.ENTER)  # 回车键
    #     actions.perform()

    def sear_result(self):
        '''
        单击查找完成后，获取查找结果
        :return:
        '''
        return self.text(resultx)

    # +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    def addeds(self):
        self.click(xingzhen)

    def add_wuliao_type(self):
        # 物料产品类型
        self.click(scommodity)  # 点击下拉框
        actions = ActionChains(self.driver)  # 定义动作链
        actions.send_keys(Keys.DOWN)  # 下键
        actions.send_keys(Keys.ENTER)  # 回车键
        actions.perform()

    def wenhaoa(self):
        self.click(wenhao)

    # 衣服输入框
    def clotheses(self, value):
        self.send_keys(clothese, value)

    #第2次查询
    def buttente(self):
        self.click(buttente)

    #再次点击新增
    def addqere(self):
        self.click(addqere)


    def resultss(self):
        self.click(buttent)

    def resultsee(self):
        '''
        单击查找完成后，获取查找结果
        :return:
        '''
        return self.is_exists(nodata)

    # 新增
    def addqerer(self):
        self.click(addqer)

    # 消除提示框
    def elromptss(self):
        self.click(elrompts)

    # 请输入名称
    def peasenames(self, value):
        self.send_keys(peasename, value)

    # 输入框请输入单位
    def pleaseunitw(self, value):
        self.send_keys(pleaseunit, value)

    # 添加里面的确定
    def addconfirmations(self):
        self.click(addconfirmation)

    def cancel_toexamine(self):
        self.click(cancel_toexamine)

    def cenct_uy(self,value):
        self.send_keys(input_rline,value)


    #关闭
    def sdp_copy(self):
        self.click(sdp_copy)



    #点击查询
    def dinchi_pi(self):
        self.click(dinchi)

    #再次输入确定
    def srkoniuq(self):
        self.click(input_rline)  # 点击输入框
        actions = ActionChains(self.driver)  # 定义动作链
        actions.send_keys(Keys.ENTER)  # 发送回车键
        actions.perform()  # 执行动作链

    #关闭
    def close_add(self):
        self.click(close_add)

    #关闭ESC
    def esc_add(self):
        self.click(esc_add)

    #主关闭
    def zhu_add(self):
        self.click(zhu_add)

    # 正确的打勾
    def check_adde(self):
        self.click(check_adde)

    #添加的断言
    def assertion_add(self):
        return self.get_input_value(assertion_add)

    def information_add(self):
        return self.text(information_add)


    #点击确定
    def sure_wareho(self):
        self.click(sure_wareho)

    #刷新页面
    def windowsreset(self):
        self.driver.refresh()

    #断言的结果
    def assert_editing(self):
        return self.text(assert_editing)

    #回车
    # 再次输入确定
    def fieutfb(self):
        self.click(clothese)  # 点击输入框
        actions = ActionChains(self.driver)  # 定义动作链
        actions.send_keys(Keys.ENTER)  # 发送回车键
        actions.perform()  # 执行动作链

    # 打勾
    def dagoe(self):
        self.click(dago)

    # 点击确定
    def addteine(self):
        self.click(addtein)

    #确定
    def clicttosave_id(self):
        self.click(clicttosave)

    # 点击完添加结果
    def resultssr(self):
        return self.is_exists(results)

    # 点击查看
    def see_sernt_asd(self):
        self.click(see_sernt)

    # 取消
    def cancel_qwe_asd(self):
        self.click(cancel_qwe_id)

    # 判断详情是否出现
    def does_it_appear_id(self):
        return self.is_exists(does_it_appear)

    # 选中
    def choice_sda(self):
        self.click(choice)

    # 批量操作
    def batch_operation_asd(self):
        self.click(batch_operation)

    # 反审核
    def anti_audit_asd(self):
        self.click(anti_audit)

    # 确定
    def addtein_qwe_asd(self):
        self.click(addtein_qwe)

    # 点击保存
    def click_ko_qwe(self):
        self.click(click_ko)

    # 再次点击审核
    def again_ok_ieu(self):
        self.click(again_ok)

    # 结果
    def confirm_operation_asd(self):
        return self.is_exists(confirm_operation)

    # 编辑
    def edit_ioniu(self):
        self.click(edit_ion)

    # 输入数量
    def quantity_ie(self, value):
        self.send_keys(quantityq, value)

    def ert_qeewe(self,value):
        self.send_keys(ert_qeewe,value)

    #保存你输入的值
    def save_the_results(self):
        return self.get_input_value(save_the_results)

    # 保存
    def ok_qeew_qwe(self):
        self.click(ok_qeew)

    #取消
    def quxi_toexamine(self):
        self.click(quxi_toexamine)

    # 结果
    def qweret_poi(self):
        return self.is_exists(qweret)

    # 复制
    def fuz_qwe(self):
        self.click(fuz)

    # 插入行
    def insert_qewr(self):
        self.click(insert)

    # 放大镜
    def magnifier_qwe(self):
        self.click(magnifier)

    # 输入框
    def srkoniu(self, value):
        return self.send_keys(input_rline, value)

        # 输入框
    def srkoniuel(self, value):
        return self.send_keys(input_rlinee, value)

    # 点击查询
    def dinchi_pie(self):
        self.click(dinchid)

    # 再次输入确定
    def srkoniuqc(self):
        self.click(input_rlinee)  # 点击输入框
        actions = ActionChains(self.driver)  # 定义动作链
        actions.send_keys(Keys.ENTER)  # 发送回车键
        actions.perform()  # 执行动作链

    #点击确定
    def preservationo(self):
        self.click(preservation)

    #插入行
    def insertto(self):
        self.click(insertt)

    #点击放大镜
    def magnifiert_qw(self):
        self.click(magnifiert)

    #打钩
    def selectnt_omu(self):
        self.click(selectnt)

    #点击确定
    def singlet_clickt(self):
        self.click(singlet_click)

    # #点击保存
    # def singlet_click_ino(self):
    #     self.click(singlet_click)

    #点击保存
    def click_ko_1q(self):
        self.click(click_ko)
    # 结果
    def fuzyj_qwe(self):
        return self.is_exists(fuzyj)

    # 点击删除
    def delete_prompt_box_oi(self):
        self.click(delete_prompt_box)

    # 点击删除
    def click_to_delete_qwe(self):
        self.click(click_to_delete)

    # 删除的结果
    def delete_result_qwe(self):
        return self.is_exists(delete_result)
